<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>游记详情</title>
    <link rel="icon" href="../static/img/logo2.png" type="image/png">
    <link rel="stylesheet" href="../static/css/ku/bootstrap.css">
    <link rel="stylesheet" href="../static/css/daohang.css">
    <script src="../static/js/ku/jquery.min.js"></script>
    <script src="../static/js/ku/bootstrap.js"></script>
    <link rel="stylesheet" href="../static/css/travelsdetails.css">

</head>
<body>
<nav class="navbar navbar-expand-md bg-dark navbar-dark">
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#cla1">
        <span class="navbar-toggler-icon"></span>
    </button>
    <img src="../static/img/logo1.png" alt="">
    <div class="collapse navbar-collapse" id="cla1">
        <ul class="navbar-nav" style="margin: 0 10px 0 auto">
            <li class="nav-item">
                <a class="nav-link" href="/homepage/">首页</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/search/">目的地</a>
            </li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown">
                    旅游攻略
                </a>
                <div class="dropdown-menu" style="text-align: center">
                    <a class="dropdown-item" href="/travels/">游记</a>
                    <a class="dropdown-item" href="/list/">榜单</a>
                    <a class="dropdown-item" href="/recommend/">景点推荐</a>
                </div>
            </li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown">
                    社区
                </a>
                <div class="dropdown-menu" style="text-align: center">
                    <a class="dropdown-item" href="/qa/">问答</a>
                    <a class="dropdown-item" href="/companions/">结伴</a>
                </div>
            </li>
            {% if request.session.is_login %}     
                <li class="nav-item"><a href="/house/" class="nav-link">{{ request.session.user_name }}</a></li>
                <li class="nav-item"><a href="/logout/" class="nav-link">注销账号</a></li>
            {% else %}
                <li class="nav-item"><a href="/signin/" class="nav-link">登录/注册</a></li>
            {% endif %}
        </ul>
    </div>
</nav>
<div style="width: 100%;max-height:500px;overflow: hidden;">
    <img src="{{ list.travels_img_url }}"
         alt="" style="width: 100%">
</div>
<div class="container">
    <div class="col-md-12">
        <div id="div2">
            <table>
                <tr>
                    <td rowspan="2">
                        <div style="width: 100px; height: 100px; float:left; border-radius: 50%; border: 3px solid #eee; overflow: hidden;">
                            <img src="{{ list.user_img }}"
                                 alt="" class="round" style="width: 100px; height: 100px;"></div>
                    </td>
                    <td>
                        <h3 style="color: white;font-size: 2vw">{{ list.travels_title }}</h3>
                    </td>
                </tr>
                <tr>
                    <td style="font-size: 1vw;color: #ff6600">{{ list.user_name }}{{ list.time2 }}</td>
                    {% if request.session.is_login %}
                        <td style="padding: 10px">
                            <button type="button" class="btn btn-info" onclick="shoucang(this)">{% if state == 0 %}
                                <img src="../static/img/Icon/shoucang1.png" alt="" width="20px">收藏游记{% else %}
                                <img src="../static/img/Icon/shoucang2.png" alt="" height="20px">已收藏{% endif %}
                            </button>
                            <script>
                                function shoucang(_this) {
                                    b = _this.innerText;
                                    if (b == '收藏游记') {
                                        _this.innerHTML = '<img src="../static/img/Icon/shoucang2.png" alt="" width="20px">已收藏';
                                        type = 1
                                    }
                                    else {
                                        _this.innerHTML = '<img src="../static/img/Icon/shoucang1.png" alt="" width="20px">收藏游记';
                                        type = 2
                                    }
                                    data1 = $(this).text();
                                    companion ={{ list.travels_id }};
                                    html = $.ajax({
                                        url: "/travelscollection/",
                                        type: 'POST',
                                        data: {'type': type, 'companion': companion},
                                    });
                                }
                            </script>
                        </td>
                    {% endif %}
                </tr>
            </table>
        </div>
    </div>

</div>
<div style="margin-top: 70px">
    <hr>
</div>
<div class="row">
    <div class="col-md-2"></div>
    <div class="col-md-6">
        <table id="tab1">
            <tr>
                <td><img src="../static/img/Icon/dingwei.png" alt="" width="27px">目的地：{{ list1.name1 }}</td>
                <td><img src="../static/img/Icon/shijian.png" alt="" width="27px">出发时间:{{ list.time1 }}</td>
                <td><img src="../static/img/Icon/meiyuan.png" alt="" width="27px">人均费用:{{ list.travels_cost }}</td>
            </tr>
        </table>
        <div class="col-md-8">
            <p>
                {{ list.travels_md }}
            </p>
        </div>
    </div>

    <div class="col-md-2">
        <p>相关目的地</p>
        <a href="/region/?data={{ list1.id1 }}"><h4>{{ list1.name1 }}</h4>
            <img src="{{ list1.img1 }}" alt="" width="90%"></a>
    </div>
    <div class="col-md-2"></div>
</div>
<div class="row clearfix" style="background:rgba(52,58,64,1)">
    <div class="col-md-2 column">
    </div>
    <div class="col-md-8 column">
        <div id="fool" style="width: 100%;text-align: center;height: 100px;color: #e2e3e5;">
            <p style="margin-top: 20px">© 2018 meetjinn.com 京ICP备0000000号
                <img src="http://images.mafengwo.net/images/footer/police_record.png"
                     width="12" style="margin:0 2px 4px 0;">公网安备000000000号<span
                        class="m_l_10">违法和不良信息举报电话: ---------- 举报邮箱 ----------</span></p>
            <p>网络出版服务许可证：----------<span class="m_l_10">增值电信业务经营许可证：京00000000</span> 营业执照帮助中心<span
                    class="m_l_10">觅景客服:</span><span
                    class="highlight">4006-000-000</span>
            </p>
        </div>
    </div>
    <div class="col-md-2 column">
    </div>
</div>
<div>
    <a class="to-top" style="z-index: 999"><img src="../static/img/Icon/huidao.png" alt="" width="60px"></a>
    <script>!function (o) {
        "use strict";
        o.fn.toTop = function (t) {
            var i = this, e = o(window), s = o("html, body"),
                n = o.extend({autohide: !0, offset: 420, speed: 500, position: !0, right: 15, bottom: 30}, t);
            i.css({cursor: "pointer"}), n.autohide && i.css("display", "none"), n.position && i.css({
                position: "fixed",
                right: n.right,
                bottom: n.bottom
            }), i.click(function () {
                s.animate({scrollTop: 0}, n.speed)
            }), e.scroll(function () {
                var o = e.scrollTop();
                n.autohide && (o > n.offset ? i.fadeIn(n.speed) : i.fadeOut(n.speed))
            })
        }
    }(jQuery);
    $(function () {
        $('.to-top').toTop();
    });
    </script>
</div>
</body>
</html>